function renderPage(url, data, req, res) {

  // if (req.session && req.session.userInfo) {
    res.render(url, data)
  // } else {
  //   req.session.oldUrl = req.url;
  //   res.redirect(302, '/admin/login');
  // }
}

module.exports = {
  showIndex(req, res) {
    renderPage('admin/index', {}, req, res);
  },
  showPosts(req, res) {
    renderPage('admin/posts', {}, req, res);
  },
  showPostAdd(req, res) {
    renderPage('admin/post-add', {}, req, res);
  },
  showCategory(req, res) {
    renderPage('admin/categories', {}, req, res);
  },
  showComments(req, res) {
    renderPage('admin/comments', {}, req, res);
  },
  showUsers(req, res) {
    renderPage('admin/users', {}, req, res);
  },
  showNavMenus(req, res) {
    renderPage('admin/nav-menus', {}, req, res);
  },
  showSlides(req, res) {
    renderPage('admin/slides', {}, req, res);
  },
  showSettings(req, res) {
    renderPage('admin/settings', {}, req, res);
  },
  showLogin(req, res) {
    res.render('admin/login', {});
  }
}